<?php use_stylesheet('jobs.css') ?>

<div id="jobs">
    <?php foreach ($categories as $category): ?>
        <div class="category_<?php echo Jobeet::slugify($category->getName()) ?>">
            <div class="category">
                <div class="feed">
                    <a href="<?php echo url_for('category_list', array('sf_subject' => $category, 'sf_format' => 'atom')) ?>">Feed</a>
                </div>
                <h1><a href="<?php echo url_for(array('sf_route' => 'category_list', 'sf_subject' => $category)) ?>"><?php echo $category; ?></a>
                </h1>
            </div>

            <?php include_partial('sfJobeetJob/list', array('jobs' => $category->getActiveJobs(sfConfig::get('app_max_jobs_on_homepage')))) ?>

            <?php if (($count = $category->countActiveJobs() - sfConfig::get('app_max_jobs_on_homepage')) > 0): ?>
                <div class="more_jobs">
                    <?php echo __('and %count% more...', array('%count%' => link_to($count, 'category_list', $category))) ?>
                </div>
            <?php endif; ?>

        </div>
    <?php endforeach; ?>
</div>